//! @Author: DengLibin
//! @Date: Create in 2024-07-24 17:45:03
//! @Description:
//!

mod test {
    use rust_my_tools::component::comp_jwt::{generate_token, verify_token};

    // cargo.exe test --package rust_my_tools --test jwt_test -- test::test_generate_token --exact --show-output 
    #[test]
    pub fn test_generate_token() {
        let token = generate_token("张三".into(), 60 * 60 * 24).unwrap();
        println!("token:{}", token);
    }

    #[test]
    pub fn test_validate_token() {
        let token = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiIsImtpZCI6ImJsYWJsYSJ9.eyJzdWIiOiLlvKDkuIkiLCJleHAiOjE3MjE5MDI0NTl9.vg8ENR0o1suePwguKuvr7leO481rijeAaOExcj03-2s";
        let msg = verify_token(token).unwrap();
        println!("msg:{:?}", msg)
    }
}
